class_name Sundry
extends RefCounted



## 根据玩家组查找玩家节点，此方法需要在执行完第一帧之后使用
static func find_player(tree: SceneTree) -> Player:
	return tree.get_first_node_in_group(Globals.GROUP_PLAYER) as Player


## 返回成功的几率
static func success_chance(chance: float, max_chance: float = 100.0) -> bool:
	var val := randf_range(0.0, max_chance)
	return val < chance


## 围绕中心点产生随机位置
static func random_position_surround(center: Vector2, radius: float):
	var random := randf_range(0, TAU) * radius
	return center + Vector2.RIGHT.rotated(random)
